<?php
declare(strict_types=1);
namespace cms\system\admin\mvc_controller;

use Hyperf\Contract\ApplicationInterface;
use Hyperf\HttpServer\Annotation\AutoController;
use Hyperf\Utils\ApplicationContext;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\NullOutput;

/**
 * Class TestController
 * @package cms\system\admin\mvc_controller
 * @AutoController(prefix="mvc/system/admin_test")
 */
class TestController extends AbstractController
{
    public function t001()
    {
        $input = new ArrayInput([
            'command' => 'system:test'
        ]);
        $output = new NullOutput();
        $container = ApplicationContext::getContainer();
        $application = $container->get(ApplicationInterface::class);
        // $application->setAutoExit(false);
        // $result = $application->run($input, $output);
        $result = $application->find('system:test')->run($input, $output);
        var_dump($result);
    }
}